<?php
//include("../chk.php");
include("../common/conn.php");
include("../common/publicFun.php");
$current_folder_id=CheckNum(GetQuery("current_folder_id"),0,-1);//欲将在此目录下创建目录
$name=urldecode(GetQuery("name"));
$do=urldecode(GetQuery("do"));
?><!DOCTYPE HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript" type="text/JavaScript" src="../js/common.js"></script>
<script language="JavaScript" type="text/JavaScript" src="../js/jQuery1.6.2.js"></script>
<script language="JavaScript" type="text/JavaScript" src="../js/jquery.form.js"></script>

<script src="../js/dialog/artDialog.source.js?skin=default"></script>
<script src="../js/dialog/iframeTools.js"></script>
<style>
html,body{border:none 0;}
body{font-size:75%;color:#666;}
a{color:#214FA3;}
a:hover{text-decoration:underline;}
#login-form{margin:10px;}
#login-form p{padding:5px;}
#login-form input{padding:4px; border:1px solid #CCC;}
#login-form input:focus{border-color:#426DC9;}
#login-form .login-form-error{background:#FFFBFC; border-color:#F00 !important;}
html{overflow:hidden;}
</style>
<script>
function btn_restore(){
  api=art.dialog.open.api;
  api.button({
    name:'保存',
    disabled:false
  });
}

$(document).ready(function(){
  $(document).bind("contextmenu",function(){return false;});
  //$(document).bind("selectstart",function(){return false;});

  var parent=art.dialog.parent,
  api=art.dialog.open.api;
  if(!api) return;
  api.button(
    {
      name:'保存',
      callback:function(){
        var name=trim($("#name").val());
        if(name==''){$("body").focus();art.dialog.tips('请填写目录名称');return false;}
        if(mmLength(name)>20){$("body").focus();art.dialog.tips('目录名称不能超过20字符');return false;}
        this.button({
          name:'保存',
          disabled:true
        });
        $.post("SaveFolder.php",$("#login-form").serialize(),function(s){
          $("#result").html(s);
        });
        return false;
      },
      focus:true
    },
    {
      name:'放弃'
    }
  );
  $("body").focus();
});
</script>
</head>
<body><span id="result"></span>
<form id="login-form" method="post">
<p><label>目录名称：<input id="name" name="name" type="text" value="<?php echo $name;?>" /></label></p>
<input id="current_folder_id" name="current_folder_id" type="hidden" value="<?php echo $current_folder_id;?>" />
<input id="do" name="do" type="hidden" value="<?php echo $do;?>" />
</form>
</body>
</html>